package beans;

import java.util.ArrayList;
import java.util.List;
import task.ExerciseSheet;
import task.Task;
import user.ScoreGroup;
import user.User;

/**
 *
 * @author Thorsten Ludwig
 */
public class ScoreGroupContainer {
    
    private ScoreGroup sg;
    
    private List<GroupScoreCell> scores;

    public ScoreGroupContainer(ScoreGroup sg, ExerciseSheet sheet, List<User> users) {
        this.sg = sg;
        int count = 0;
        List<Integer> ints = new ArrayList<Integer>();
        this.scores = new ArrayList<GroupScoreCell>();
        for (User u: sg.getUsers()) {
            ints.add(users.indexOf(u));
        }
        for (Task e: sheet.getExercises()) {
            this.scores.add(new GroupScoreCell(count++,ints));
        }
    }

    public ScoreGroup getSg() {
        return sg;
    }

    public void setSg(ScoreGroup sg) {
        this.sg = sg;
    }

    public List<GroupScoreCell> getScores() {
        return scores;
    }

    public void setScores(List<GroupScoreCell> scores) {
        this.scores = scores;
    }
}
